package org.zhq.box;

import org.zhq.core.ReceivePacket;

import java.io.ByteArrayOutputStream;

/**
 * 定义最基础的基于的输出接收包
 *
 * @author zhengquan
 * @date 2019/2/5
 */
public abstract class AbsByteArrayReceivePacket<Entity> extends ReceivePacket<ByteArrayOutputStream,Entity> {
    public AbsByteArrayReceivePacket(long len) {
        super(len);
    }

    /**
     * 创建流操作直接返回一个流
     *
     * @return
     */
    @Override
    protected final ByteArrayOutputStream createStream() {
        return new ByteArrayOutputStream((int) length);
    }
}
